Improved dev scripting for docs authoring - #765
Draft
timothyb89 wants to merge 1 commit into
Draft
Conversation
This is an improved `yarn dev`-style helper that: - Reliably handles file changes without crashing when includes change - Doesn't leave `docasaurus` processes running on close - Selectively includes only specified versions (latest by default) to greatly reduce memory use. While working on docs, I found that edit to an include file would put the existing `yarn dev` script into a restart loop, forcing it to copy files again from scratch, restart `docasaurus` on a new port due to a conflict, pop a new browser tab, and usually get stuck in a failed state. It also usually left zombie processes running. I asked Claude to take a look at existing tooling to see if the bash + rsync situation could be merged into a proper tool, and this is what it came up with. It manages the `docasaurus` processes properly, and solves the include problem by maintaining its own include dependency graph and triggering specific copy/rerender operations without having to restart `docasaurus`. Then, since I'm perpetually running out of memory on my MacBook, I also had it find some nonintrusive ways to reduce memory use from the default ~6 GiB. This (by default) disables sourcemaps and some debug features that aren't helpful when working on just Markdown, and only renders the latest version. These tweaks brought memory use down to ~2.6GiB on my machine. As a note, this is totally vibe coded and should probably not be merged as-is. Still, it's proven to be pretty robust for me so far and has been a nice improvement, so I figured it might be worth sharing.
|
Amplify deployment status
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is an improved
yarn dev-style helper that:docasaurusprocesses running on closeWhile working on docs, I found that edit to an include file would put the existing
yarn devscript into a restart loop, forcing it to copy files again from scratch, restartdocasauruson a new port due to a conflict, pop a new browser tab, and usually get stuck in a failed state. It also usually left zombie processes running.I asked Claude to take a look at existing tooling to see if the bash
docasaurusprocesses properly, and solves the include problem by maintaining its own include dependency graph and triggering specific copy/rerender operations without having to restartdocasaurus.Then, since I'm perpetually running out of memory on my MacBook, I also had it find some nonintrusive ways to reduce memory use from the default ~6 GiB. This (by default) disables sourcemaps and some debug features that aren't helpful when working on just Markdown, and only renders the latest version. These tweaks brought memory use down to ~2.6GiB on my machine.
As a note, this is totally vibe coded and should probably not be merged as-is, so I'm leaving it as a draft. Still, it's proven to be pretty robust for me so far and has been a nice improvement, so I figured it might be worth sharing. It doesn't modify the existing
docs-websitecode at all and is safe to copy into your local clone without touching any real code. If desired, you can set up a local ignore in.git/info/excludeso it stays out of future commits.